<%@page import="com.hcfly.vo.Emp"%>
<%@page import="java.util.List"%>
<%@page import="org.apache.jasper.tagplugins.jstl.core.Catch"%>
<%@page import="java.util.Iterator"%>
<%@page import="com.hcfly.factory.DAOFactory"%>
<%@page import="java.util.Dictionary"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>列表</title>
<% request.setCharacterEncoding("utf-8"); %>
</head>
<body>
<%
	try{
		String keyWord = request.getParameter("kw");
		if(keyWord == null){
			keyWord = "";
		}
		List<Emp> all = DAOFactory.getIEmpDAOInstance().findAll(keyWord);
		Iterator<Emp> iter = all.iterator();
	
%>
<center>
        <form action="" method="post">
            <input type="text" name="kw">
            <input type="submit" value="查询">

        </form>
        <table border="1" width="80%">
            <tr>
                <td>雇员编号：</td>
                <td>雇员姓名：</td>
                <td>雇员工作：</td>
                <td>雇员工资：</td>
                <td>雇员日期：</td>
            </tr>
            <% while(iter.hasNext()){
            	Emp emp = iter.next();
            	
            	%>
            <tr>
                <td><%= emp.getEmpno() %></td>
                <td><%= emp.getEname() %></td>
                <td><%= emp.getJob() %></td>
                <td><%= emp.getSal() %></td>
                <td><%= emp.getHiredate() %></td>
            </tr>
            <%
            }
            %>
        </table>
        
        <a href="emp_insert.jsp">跳转到插入页面</a>

    </center>
    <%
    }catch(Exception e){
    	e.printStackTrace();
    }
    %>
</body>
</html>